<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>flex伸缩布局案例</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .layout {
            width: 520px;
            height: 680px;
            margin: auto;
            /* 设置当前父容器成为伸缩盒子 */
            display: flex;
            /* 设置当前元素为·列·方式铺开 */
            flex-direction: column;
        }
        header {
            width: 100%;
            height: 20px;
            background-color: blue;
        }
        main {
            width: 100%;
            background-color: red;
            /* 让当前伸缩项占据父容器剩余的空间 */
            flex: 1;
            /* 让当前父容器成为伸缩盒子 */
            display: flex;
        }
        main > article {
            height: 100%;
            background-color: pink;
            flex: 1;
        }
        main > aside {
            height: 100%;
            background-color: yellow;
            flex: 4;
        }
        footer {
            width: 100%;
            height: 20px;
            background-color: purple;
        }
    </style>
</head>
<body>
    <div class="layout">
        <header></header>
        <main>
            <article></article>
            <aside></aside>
        </main>
        <footer></footer>
    </div>
</body>
</html>
